/**
 * @file implements ScopeRouter
 * @author CORSAIR <vladimir.corsair@gmail.com>
 * @version 1
 */

/**
 * @returns {ScopeRouter}
 */
var ScopeRouter = function () {};

/**
 * 
 * @param {Function} func
 * @param {Number} ms
 * @param {Object} scope
 * @returns {Number} return the id from [native]setInterval
 */
ScopeRouter.prototype.setScopedInterval = function (func, ms, scope) {
    return setInterval(function() {
        func.call(scope);
    }, ms);
};

/**
 * 
 * @param {Function} func
 * @param {Number} ms
 * @param {Object} scope
 * @returns {Number} return the id from [native]setTimeout
 */
ScopeRouter.prototype.setScopedTimeout = function (func, ms, scope) {
    return setTimeout(function() {
        func.call(scope);
    }, ms);
};